import Vue from "vue";
import ImageViewer from "./imageViewer.vue";
import {readDataURL} from "../../previewUtil.js";

/**
 * 图片渲染
 */
export default async function renderImage(buffer,target){
    const url=await readDataURL(buffer);
    return new Vue({
        render:(h)=>{
            return h(ImageViewer,{props:{image:url}});
        }
    }).$mount(target);
};